home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / Ang261Lib.lha / src / externs.h < prev    next >
C/C++ Source or Header  |  1994-10-22  |  35KB  |  1,393 lines

  1. /* externs.h: declarations for global variables and initialized data
  2.  
  3.    Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
  4.  
  5.    This software may be copied and distributed for educational, research, and
  6.    not for profit purposes provided that this copyright and statement are
  7.    included in all such copies. */
  8.  
  9. #define get_Yn get_check
  10.  
  11. #include <stdio.h>
  12.  
  13. /* many systems don't define these anywhere */
  14. #if defined(USG) || defined(DGUX) || defined(atarist) || defined(AMIGA)
  15. #if !(defined(HPUX) || defined(linux))
  16. extern int sprintf();
  17. #endif
  18. #else
  19. #if !(defined(MSDOS) || defined(NeXT) || defined(ultrix) || defined(linux) \
  20. || defined(__386BSD__) || defined(SOLARIS))
  21. extern char *sprintf();
  22. #endif
  23. #endif
  24.  
  25. #ifndef MSDOS
  26. extern int errno;
  27. #endif
  28.  
  29. extern char *copyright[5];
  30.  
  31. extern int player_uid;
  32. extern int NO_SAVE;
  33.  
  34. /* horrible hack: needed because compact_monster() can be called from deep
  35.    within creatures() via place_monster() and summon_monster() */
  36. extern int hack_monptr;
  37.  
  38. extern int16 log_index;            /* Index to log file. -CJS- */
  39. extern vtype died_from;
  40. extern vtype savefile;            /* The save file. -CJS- */
  41.  
  42. /* These are options, set with set_options command -CJS- */
  43. extern int rogue_like_commands;
  44. extern int find_cut;            /* Cut corners on a run */
  45. extern int find_examine;        /* Check corners on a run */
  46. extern int find_prself;            /* Print yourself on a run (slower) */
  47. extern int find_bound;            /* Stop run when the map shifts */
  48. extern int prompt_carry_flag;    /* auto-pickupobjects */
  49. extern int show_weight_flag;    /* Display weights in inventory */
  50. extern int show_equip_weight_flag;    /* Display weights in equip list -CWS */
  51. extern int highlight_seams;        /* Highlight magma and quartz */
  52. extern int find_ignore_doors;    /* Run through open doors */
  53. extern int delay_spd;            /* 1-10 for delays */
  54. extern int hitpoint_warn;        /* Low hitpoint warning */
  55. extern int peek;                /* should we display additional msgs */
  56. extern int carry_query_flag;    /* ask whether to pick something up */
  57. extern int is_home;                /* are we in our home? */
  58. extern int in_store_flag;        /* Don't redisplay light in stores -DGK */
  59. extern int plain_descriptions;    /* don't add color to any obj -CWS */
  60. extern int no_haggle_flag;        /* does the player have to haggle? -CWS */
  61. extern int quick_messages;        /* do quick messages -CWS */
  62. extern int equippy_chars;        /* do equipment characters -CWS */
  63. extern int coin_type;            /* remember Creeping _xxx_ coin type -CWS */
  64. extern int opening_chest;        /* do not generate another chest -CWS */
  65.  
  66. /* Unique artifact weapon flags */
  67. extern int32 GROND, RINGIL, AEGLOS, ARUNRUTH, MORMEGIL, ANGRIST, GURTHANG,
  68.   CALRIS, ANDURIL, STING, ORCRIST, GLAMDRING, DURIN, AULE, THUNDERFIST,
  69.   BLOODSPIKE, DOOMCALLER, NARTHANC, NIMTHANC, DETHANC, GILETTAR, RILIA,
  70.   BELANGIL, BALLI, LOTHARANG, FIRESTAR, ERIRIL, CUBRAGOL, BARD, COLLUIN,
  71.   HOLCOLLETH, TOTILA, PAIN, ELVAGIL, AGLARANG, EORLINGAS, BARUKKHELED,
  72.   WRATH, HARADEKKET, MUNDWINE, GONDRICAM, ZARCUTHRA, CARETH, FORASGIL,
  73.   CRISDURIAN, COLANNON, HITHLOMIR, THALKETTOTH, ARVEDUI, THRANDUIL, THENGEL,
  74.   HAMMERHAND, CELEGORM, THROR, MAEDHROS, OLORIN, ANGUIREL, OROME,
  75.   EONWE, THEODEN, ULMO, OSONDIR, TURMIL, TIL, DEATHWREAKER, AVAVIR, TARATOL;
  76.  
  77. /* Unique artifact armour flags */
  78. extern int32 DOR_LOMIN, NENYA, NARYA, VILYA, BELEGENNON, FEANOR, ISILDUR,
  79. SOULKEEPER, FINGOLFIN, ANARION, POWER, PHIAL, BELEG, DAL, PAURHACH,
  80. PAURNIMMEN, PAURAEGEN, PAURNEN, CAMMITHRIM, CAMBELEG, INGWE, CARLAMMAS,
  81. HOLHENNETH, AEGLIN, CAMLOST, NIMLOTH, NAR, BERUTHIEL, GORLIM, ELENDIL,
  82. THORIN, CELEBORN, THRAIN, GONDOR, THINGOL, THORONGIL, LUTHIEN, TUOR, ROHAN,
  83. TULKAS, NECKLACE, BARAHIR, CASPANION, RAZORBACK, BLADETURNER;
  84.  
  85. /* Brand new extra effecient and kind way to add unique monsters... HOORAY!! */
  86. extern struct unique_mon u_list[MAX_CREATURES];
  87.  
  88. extern int quests[MAX_QUESTS];
  89.  
  90. /* global flags */
  91. extern int unfelt;
  92. extern int in_store_flag;        /* flag so equippy chars work right -DGK */
  93. extern int good_item_flag;        /* True if an artifact has been created... */
  94. extern int LOAD;
  95. extern int new_level_flag;        /* Next level when true  */
  96. extern int teleport_flag;        /* Handle teleport traps  */
  97. extern int eof_flag;            /* Used to handle eof/HANGUP */
  98. extern int player_light;        /* Player carrying light */
  99. extern int light_rad,old_rad;           /* Light radius */
  100. extern int find_flag;            /* Used in MORIA          */
  101. extern int free_turn_flag;        /* Used in MORIA          */
  102. extern int weapon_heavy;        /* Flag if the weapon too heavy -CJS- */
  103. extern int pack_heavy;            /* Flag if the pack too heavy -CJS- */
  104. extern char doing_inven;        /* Track inventory commands */
  105. extern int screen_change;        /* Screen changes (used in inven_commands) */
  106. extern int be_nasty;
  107. extern int monster_is_afraid;    /* redo monster fear messages -CWS */
  108.  
  109. extern int character_generated;    /* don't save score until char gen finished */
  110. extern int character_saved;        /* prevents save on kill after save_char() */
  111. extern int feeling;                /* level feeling */
  112. extern int highscore_fd;        /* High score file descriptor */
  113. extern int command_count;        /* Repetition of commands. -CJS- */
  114. extern int default_dir;            /* Use last direction in repeated commands */
  115. extern int16 noscore;            /* Don't score this game. -CJS- */
  116. extern int32u randes_seed;        /* For encoding colors */
  117. extern int32u town_seed;        /* Seed for town generation */
  118. extern char *old_state;            /* state array initialized by time -CWS */
  119. extern char *dummy_state;        /* dummy state array so that town/colors look
  120.                                  * the same -CWS */
  121.  
  122. extern int16 dun_level;         /* Cur dungeon level   */
  123. extern int16 object_level;        /* used to generate objects -CWS */
  124. extern int16 missile_ctr;        /* Counter for missiles */
  125. extern int msg_flag;            /* Set with first msg  */
  126. extern vtype old_msg[MAX_SAVE_MSG];    /* Last messages -CJS- */
  127. extern int16 last_msg;            /* Where in the array is the last */
  128. extern int death;                /* True if died          */
  129. extern int32 turn;                /* Cur turn of game    */
  130. extern int32 old_turn;            /* last turn feeling was felt */
  131. extern int wizard;                /* Wizard flag          */
  132. extern int to_be_wizard;
  133. extern int16 panic_save;        /* this is true if playing from a panic save */
  134.  
  135. extern int wait_for_more;
  136.  
  137. extern char days[7][29];
  138. extern int closing_flag;        /* Used for closing   */
  139.  
  140. extern int16 cur_height, cur_width;    /* Cur dungeon size    */
  141. /*  Following are calculated from max dungeon sizes        */
  142. extern int16 max_panel_rows, max_panel_cols;
  143. extern int panel_row, panel_col;
  144. extern int panel_row_min, panel_row_max;
  145. extern int panel_col_min, panel_col_max;
  146. extern int panel_col_prt, panel_row_prt;
  147.  
  148. #ifdef TARGET
  149. /* Targetting code, stolen from Morgul -CFT */
  150. extern int target_mode;
  151. extern int16u target_col;
  152. extern int16u target_row;
  153. extern int16u target_mon;
  154. #endif
  155.  
  156. /*  Following are all floor definitions                */
  157. #ifdef MAC
  158. extern cave_type (*cave)[MAX_WIDTH];
  159. #else
  160. extern cave_type cave[MAX_HEIGHT][MAX_WIDTH];
  161. #endif
  162.  
  163. /* Following are player variables                */
  164. extern player_type py;
  165. #ifdef MACGAME
  166. extern char *(*player_title)[MAX_PLAYER_LEVEL];
  167. extern race_type *race;
  168. extern background_type *background;
  169. #else
  170. extern char *player_title[MAX_CLASS][MAX_PLAYER_LEVEL];
  171. extern race_type race[MAX_RACES];
  172. extern background_type background[MAX_BACKGROUND];
  173. #endif
  174. extern int32u player_exp[MAX_PLAYER_LEVEL];
  175. extern int16u player_hp[MAX_PLAYER_LEVEL];
  176. extern int16 char_row;
  177. extern int16 char_col;
  178.  
  179. #if 0 /* not used? */
  180. extern char *dsp_race[MAX_RACES]; /* Short strings for races. -CJS- */
  181. #endif
  182.  
  183. extern int8u rgold_adj[MAX_RACES][MAX_RACES];
  184.  
  185. extern class_type class[MAX_CLASS];
  186. extern int16 class_level_adj[MAX_CLASS][MAX_LEV_ADJ];
  187.  
  188. /* Warriors don't have spells, so there is no entry for them. */
  189. #ifdef MACGAME
  190. extern spell_type (*magic_spell)[63];
  191. #else
  192. extern spell_type magic_spell[MAX_CLASS-1][63];
  193. #endif
  194. extern const char *spell_names[127];
  195. extern int32u spell_learned;    /* Bit field for spells learnt -CJS- */
  196. extern int32u spell_learned2;    /* Bit field for spells learnt -CJS- */
  197. extern int32u spell_worked;        /* Bit field for spells tried -CJS- */
  198. extern int32u spell_worked2;    /* Bit field for spells tried -CJS- */
  199. extern int32u spell_forgotten;    /* Bit field for spells forgotten -JEW- */
  200. extern int32u spell_forgotten2;    /* Bit field for spells forgotten -JEW- */
  201. extern int8u spell_order[64];    /* remember order that spells are learned in */
  202. extern int32u spellmasks[MAX_CLASS][2];
  203. /* used to check if player knows all spells knowable to him -CFT */
  204. extern int16u player_init[MAX_CLASS][5];
  205. extern int16 total_winner;
  206.  
  207. /* Following are store definitions                */
  208. #ifdef MACGAME
  209. extern owner_type *owners;
  210. #else
  211. extern owner_type owners[MAX_OWNERS];
  212. #endif
  213. #ifdef MAC
  214. extern store_type *store;
  215. #else
  216. extern store_type store[MAX_STORES];
  217. #endif
  218. extern int16u store_choice[MAX_STORES][STORE_CHOICES];
  219. #ifndef MAC
  220. extern int (*store_buy[MAX_STORES])();
  221. #endif
  222.  
  223. /* Following are treasure arrays    and variables            */
  224. #ifdef MACGAME
  225. extern treasure_type *object_list;
  226. #else
  227. extern treasure_type object_list[MAX_OBJECTS];
  228. #endif
  229. extern int8u object_ident[OBJECT_IDENT_SIZE];
  230. extern int16 t_level[MAX_OBJ_LEVEL+1];
  231. extern inven_type t_list[MAX_TALLOC];
  232. extern inven_type inventory[INVEN_ARRAY_SIZE];
  233. extern const char *special_names[SN_ARRAY_SIZE];
  234. extern int16 sorted_objects[MAX_DUNGEON_OBJ];
  235. extern int16 inven_ctr;            /* Total different obj's    */
  236. extern int16 inven_weight;        /* Cur carried weight    */
  237. extern int16 equip_ctr;            /* Cur equipment ctr    */
  238. extern int16 tcptr;                /* Cur treasure heap ptr    */
  239.  
  240. /* Following are creature arrays and variables            */
  241. #ifdef MACGAME
  242. extern creature_type *c_list;
  243. #else
  244. extern creature_type c_list[MAX_CREATURES];
  245. #endif
  246. extern describe_mon_type desc_list[MAX_CREATURES];
  247. extern monster_type m_list[MAX_MALLOC];
  248. extern int16 m_level[MAX_MONS_LEVEL+1];
  249. extern m_attack_type monster_attacks[N_MONS_ATTS];
  250. #ifdef MAC
  251. extern recall_type *c_recall;
  252. #else
  253. extern recall_type c_recall[MAX_CREATURES];    /* Monster memories. -CJS- */
  254. #endif
  255. extern monster_type blank_monster; /* Blank monster values    */
  256. extern int16 mfptr;                   /* Cur free monster ptr    */
  257. extern int16 mon_tot_mult;           /* # of repro's of creature    */
  258.  
  259. /* Following are arrays for descriptive pieces            */
  260. #ifdef MACGAME
  261. extern const char **colors;
  262. extern const char **mushrooms;
  263. extern const char **woods;
  264. extern const char **metals;
  265. extern const char **rocks;
  266. extern const char **amulets;
  267. extern const char **syllables;
  268. #else
  269. extern const char *colors[MAX_COLORS];
  270. extern const char *mushrooms[MAX_MUSH];
  271. extern const char *woods[MAX_WOODS];
  272. extern const char *metals[MAX_METALS];
  273. extern const char *rocks[MAX_ROCKS];
  274. extern const char *amulets[MAX_AMULETS];
  275. extern const char *syllables[MAX_SYLLABLES];
  276. #endif
  277.  
  278. extern int8u blows_table[11][12];
  279.  
  280. extern int16u normal_table[NORMAL_TABLE_SIZE];
  281.  
  282. /* Initialized data which had to be moved from some other file */
  283. /* Since these get modified, macrsrc.c must be able to access them */
  284. /* Otherwise, game cannot be made restartable */
  285. /* dungeon.c */
  286. extern char last_command;        /* Memory of previous command. */
  287. /* moria1.c */
  288. /* Track if temporary light about player.  */
  289. extern int light_flag;
  290.  
  291. #ifdef MSDOS
  292. extern int8u    floorsym, wallsym;
  293. extern int    ansi, saveprompt;
  294. extern char    moriatop[], moriasav[];
  295. #endif
  296.  
  297.  
  298. /* If you use NEW_FILEPATHS, we need these externs; if you use OLD_FILEPATHS */
  299. /* these are #define'd to something, so they aren't variables.         [cjh] */
  300. #ifdef NEW_FILEPATHS
  301. extern char *ANGBAND_TST;        /* was LIBDIR(test)                    */
  302. extern char *ANGBAND_HOU;        /* was LIBDIR(files/hours)            */
  303. extern char *ANGBAND_MOR;        /* was LIBDIR(files/news)            */
  304. extern char *ANGBAND_TOP;        /* was LIBDIR(files/newscores)        */
  305. extern char *ANGBAND_BONES;        /* was LIBDIR(bones)                */
  306. extern char *ANGBAND_HELP;        /* was LIBDIR(files/roglcmds.hlp)    */
  307. extern char *ANGBAND_ORIG_HELP;    /* was LIBDIR(files/origcmds.hlp)    */
  308. extern char *ANGBAND_WIZ_HELP;    /* was LIBDIR(files/rwizcmds.hlp)    */
  309. extern char *ANGBAND_OWIZ_HELP;    /* was LIBDIR(files/owizcmds.hlp)    */
  310. extern char *ANGBAND_WELCOME;    /* was LIBDIR(files/welcome.hlp)    */
  311. extern char *ANGBAND_LOG;        /* was LIBDIR(files/ANGBAND.log)    */
  312. extern char *ANGBAND_VER;        /* was LIBDIR(files/version.hlp)    */
  313. extern char *ANGBAND_LOAD;        /* was LIBDIR(files/loadcheck)        */
  314. extern char *ANGBAND_WIZ;        /* was LIBDIR(files/wizards)        */
  315. extern char *ANGBAND_SAV;        /* was LIBDIR(save)                    */
  316. #endif /* NEW_FILEPATHS */
  317.  
  318.  
  319. /* function return values */
  320. /* only extern functions declared here, static functions declared inside
  321.    the file that defines them */
  322. #ifdef __STDC__
  323.  
  324. /* create.c */
  325. void create_character(void);
  326.  
  327. /* creature.c */
  328. void update_mon(int);
  329. int movement_rate(int);
  330. int multiply_monster(int, int, int, int);
  331. void creatures(int);
  332.  
  333. /* death.c */
  334. void exit_game(void);
  335. void display_scores(int, int);
  336. void delete_entry(int);
  337. long total_points(void);
  338. int look_line(int);
  339.  
  340. /* desc.c */
  341. int is_a_vowel(int);
  342. void magic_init(void);
  343. void known1(inven_type *);
  344. int known1_p(inven_type *);
  345. void known2(inven_type *);
  346. int known2_p(inven_type *);
  347. void clear_known2(inven_type *);
  348. void clear_empty(inven_type *);
  349. void store_bought(inven_type *);
  350. int store_bought_p(inven_type *);
  351. void sample(struct inven_type *);
  352. void identify(int *);
  353. void unmagic_name(inven_type *);
  354. void objdes(char *, struct inven_type *, int);
  355. void scribe_object(void);
  356. void add_inscribe(inven_type *, int);
  357. void inscribe(inven_type *, const char *);
  358. void invcopy(inven_type *, int);
  359. void desc_charges(int);
  360. void desc_remain(int);
  361. int16 object_offset(inven_type *);
  362.  
  363. /* dungeon.c */
  364. void dungeon(void);
  365. int special_check(inven_type *);
  366. int is_quest(int);
  367. void rerate(void);
  368. int ruin_stat(int);
  369.  
  370. /* eat.c */
  371. void eat(void);
  372.  
  373. /* files.c */
  374. void init_scorefile(void);
  375. void init_files(void);
  376. void read_times(void);
  377. void helpfile(const char *);
  378. void print_objects(void);
  379. #ifdef MAC
  380. int file_character(void)
  381. #else
  382. int file_character(char *);
  383. #endif
  384. #ifdef NEW_FILEPATHS
  385. void get_file_paths( void );
  386. #endif
  387.  
  388. /* generate.c */
  389. void generate_cave(void);
  390.  
  391. /* help.c */
  392. void ident_char(void);
  393.  
  394. /* io.c */
  395. #ifdef SIGTSTP
  396. int suspend(void);
  397. #endif
  398. void init_curses(void);
  399. void moriaterm(void);
  400. void put_buffer(const char *, int, int);
  401. void put_qio(void);
  402. void restore_term(void);
  403. void shell_out(void);
  404. char inkey(void);
  405. void flush(void);
  406. void erase_line(int, int);
  407. void clear_screen(void);
  408. void clear_from(int);
  409. void move_cursor_relative(int, int);
  410. void count_msg_print(const char *);
  411. void prt(const char *, int, int);
  412. void move_cursor(int, int);
  413. void msg_print(const char *);
  414. int get_check(const char *);
  415. int get_com(const char *, char *);
  416. int get_string(char *, int, int, int);
  417. void pause_line(int);
  418. void pause_exit(int, int);
  419. void save_screen(void);
  420. void restore_screen(void);
  421. void bell(void);
  422. void screen_map(void);
  423. void print(int, int, int);
  424.  
  425. /* magic.c */
  426. void cast(void);
  427.  
  428. /* main.c */
  429. int main(int, char **);
  430.  
  431. /* misc1.c */
  432. void init_seeds();
  433. void set_seed(int32u);
  434. void reset_seed(void);
  435. int check_time(void);
  436. int randnor(int, int);
  437. int bit_pos(int32u *);
  438. void panel_bounds(void);
  439. int get_panel(int, int, int);
  440. int next_to_wall(int, int);
  441. int next_to_corr(int, int);
  442. int damroll(int, int);
  443. int pdamroll(int8u *);
  444. int los(int, int, int, int);
  445. unsigned char loc_symbol(int, int);
  446. int test_light(int, int);
  447. void prt_map(void);
  448. void add_food(int);
  449. int popm(void);
  450. int max_hp(int8u *);
  451. int place_monster(int, int, int, int);
  452. int place_win_monster(void);
  453. void place_group(int, int, int, int);
  454. int get_mons_num(int);
  455. void alloc_monster(int, int, int);
  456. int summon_monster(int * ,int *, int);
  457. int summon_undead(int *, int *);
  458. int summon_demon(int, int *, int *);
  459. int summon_dragon(int *, int *);
  460. int summon_wraith(int *, int *);
  461. int summon_reptile(int *, int *);
  462. int summon_spider(int *, int *);
  463. int summon_angel(int *, int *);
  464. int summon_ant(int *, int *);
  465. int summon_unique(int *, int *);
  466. int summon_jabberwock(int *, int *);
  467. int summon_gundead(int *, int *);
  468. int summon_ancientd(int *, int *);
  469. int summon_hound(int *, int *);
  470. int summon_jelly(int *, int *);
  471. int popt(void);
  472. void pusht(int);
  473. int magik(int);
  474. int m_bonus(int, int, int);
  475. void magic_treasure(int, int, int, int);
  476. void set_options(void);
  477. int compact_monsters(void);
  478. int next_to_walls(int, int);
  479. int get_nmons_num(int);
  480. int distance(int, int, int, int);
  481.  
  482. /* misc2.c */
  483. void place_trap(int, int, int);
  484. void place_rubble(int, int);
  485. void place_gold(int, int);
  486. int get_obj_num(int,int);
  487. void place_object(int, int);
  488. void alloc_object(int (*)(), int, int);
  489. void random_object(int, int, int);
  490. void cnv_stat(int, char *);
  491. void prt_stat(int);
  492. void prt_field(const char *, int, int);
  493. int stat_adj(int);
  494. int chr_adj(void);
  495. int con_adj(void);
  496. const char *title_string(void);
  497. void prt_title(void);
  498. void prt_level(void);
  499. void prt_cmana(void);
  500. void prt_mhp(void);
  501. void prt_chp(void);
  502. void prt_pac(void);
  503. void prt_gold(void);
  504. void prt_depth(void);
  505. void prt_hunger(void);
  506. void prt_blind(void);
  507. void prt_confused(void);
  508. void prt_afraid(void);
  509. void prt_poisoned(void);
  510. void prt_state(void);
  511. void prt_speed(void);
  512. void prt_study(void);
  513. void prt_winner(void);
  514. int16u modify_stat(int, int);
  515. void set_use_stat(int);
  516. int inc_stat(int);
  517. int dec_stat(int);
  518. int res_stat(int);
  519. void bst_stat(int, int);
  520. int tohit_adj(void);
  521. int toac_adj(void);
  522. int todis_adj(void);
  523. int todam_adj(void);
  524. void prt_stat_block(void);
  525. void draw_cave(void);
  526. void put_character(void);
  527. void put_stats(void);
  528. const char *likert(int, int);
  529. void put_misc1(void);
  530. void put_misc2(void);
  531. void put_misc3(void);
  532. void display_char(void);
  533. void get_name(void);
  534. void change_name(void);
  535. void inven_destroy(int);
  536. void take_one_item(struct inven_type *, struct inven_type *);
  537. void inven_drop(int, int);
  538. int inven_damage(int (*)(), int);
  539. int weight_limit(void);
  540. int inven_check_num(inven_type *);
  541. int inven_check_weight(struct inven_type *);
  542. void check_strength(void);
  543. int inven_carry(struct inven_type *);
  544. int spell_chance(int);
  545. void print_spells(int *, int, int, int);
  546. int get_spell(int *, int, int *, int *, const char *, int);
  547. void calc_spells(int);
  548. void gain_spells(void);
  549. void calc_mana(int);
  550. void prt_experience(void);
  551. void calc_hitpoints(void);
  552. void insert_str(char *, const char *, const char *);
  553. void insert_lnum(char *, const char *, int32, int);
  554. int enter_wiz_mode(void);
  555. int attack_blows(int, int *);
  556. int tot_dam(struct inven_type *, int, int);
  557. int critical_blow(int, int, int, int);
  558. int mmove(int, int *, int *);
  559. int player_saves(void);
  560. int find_range(int, int, int *, int *);
  561. void teleport(int);
  562. void check_view(void);
  563. void place_special(int, int, int32u);
  564. int place_ghost(void);
  565. void prt_cut(void);
  566. void prt_stun(void);
  567. void special_random_object(int, int, int);
  568. void cut_player(int);
  569. void stun_player(int);
  570. void prt_equippy_chars(void);
  571. void get_coin_type(creature_type *);
  572.  
  573. /* monsters.c */
  574.  
  575. /* moria1.c */
  576. void change_speed(int);
  577. void py_bonuses(struct inven_type *, int);
  578. void calc_bonuses(void);
  579. int show_inven(int, int, int, int, int ());
  580. const char *describe_use(int);
  581. int show_equip(int, int);
  582. void takeoff(int, int);
  583. int verify(const char *, int);
  584. void inven_command(int);
  585. int get_item(int *, const char *, int, int, int ());
  586. int no_light(void);
  587. int get_dir(const char *, int *);
  588. int get_alldir(const char *, int *);
  589. void move_rec(int, int, int, int);
  590. void light_room(int, int);
  591. void move_light(int, int, int, int);
  592. void disturb(int, int);
  593. void search_on(void);
  594. void search_off(void);
  595. void rest(void);
  596. void rest_off(void);
  597. int test_hit(int, int, int, int, int);
  598. void take_hit(int, const char *);
  599. void change_trap(int, int);
  600. void search(int, int, int);
  601. void find_init(int);
  602. void find_run(void);
  603. void end_find(void);
  604. void area_affect(int, int, int);
  605. int minus_ac(int32u);
  606. void corrode_gas(const char *);
  607. void poison_gas(int, const char *);
  608. void fire_dam(int, const char *);
  609. void cold_dam(int, const char *);
  610. void light_dam(int, const char *);
  611. void acid_dam(int, const char *);
  612. void darken_player(int, int);
  613.  
  614. /* moria2.c */
  615. int cast_spell(const char * ,int, int *, int *);
  616. void delete_monster(int);
  617. void fix1_delete_monster(int);
  618. void fix2_delete_monster(int);
  619. int delete_object(int, int);
  620. int32u monster_death(int, int, int32u, int32u, int32u);
  621. int mon_take_hit(int, int, int);
  622. void move_char(int, int);
  623. void openobject(void);
  624. void closeobject(void);
  625. int twall(int, int, int, int);
  626. void tunnel(int);
  627. void disarm_trap(void);
  628. void look(void);
  629. void throw_object(void);
  630. void bash(void);
  631. void delete_unique(void);
  632. void carry(int, int, int);
  633. void check_unique(monster_type *);
  634. void target(void); /* target fns stolen from Morgul -CFT */
  635. int at_target(int, int); /* target fns stolen from Morgul -CFT */
  636. void mmove2(int *, int *, int, int, int, int);
  637.  
  638. #ifdef MSDOS
  639. /* ms_misc.c */
  640. char *getlogin(void);
  641. #ifdef __TURBOC__
  642. void sleep(int);
  643. #else
  644. unsigned int sleep(int );
  645. #endif
  646. void error(char *, ...);
  647. void warn(char *, ...);
  648. void msdos_init(void);
  649. void msdos_raw(void);
  650. void msdos_noraw(void);
  651. int bios_getch(void);
  652. int msdos_getch(void);
  653. void bios_clear(void);
  654. void msdos_intro(void);
  655. void bios_clear(void);
  656. #endif
  657.  
  658. /* potions.c */
  659. void quaff(void);
  660.  
  661. /* prayer.c */
  662. void pray(void);
  663.  
  664. /* recall.c */
  665. int bool_roff_recall(int);
  666. int roff_recall(int);
  667.  
  668. /* rnd.c is unused now -CWS */
  669. /* random.c */
  670. #if !(defined(linux) || defined(__osf__))
  671. long random(void);
  672. #if !(defined(__MINT__) || defined(__386BSD__) || defined(AMIGA))
  673. void srandom(int);
  674. #endif
  675. char *initstate(unsigned int, char *, int);
  676. char *setstate(char *);
  677. #endif
  678.  
  679. /* rods.c */
  680. void activate_rod(void);
  681.  
  682. /* save.c */
  683. #ifdef MAC
  684. int save_char(int);
  685. #else
  686. int save_char(void);
  687. #endif
  688. int _save_char(char *);
  689. int get_char(int *);
  690.  
  691. /* scrolls.c */
  692. void read_scroll(void);
  693.  
  694. /* sets.c */
  695. int set_room(int);
  696. int set_corr(int);
  697. int set_floor(int);
  698. int set_corrodes(inven_type *);
  699. int set_flammable(inven_type *);
  700. int set_frost_destroy(inven_type *);
  701. int set_acid_affect(inven_type *);
  702. int set_lightning_destroy(inven_type *);
  703. int set_null(inven_type *);
  704. int set_acid_destroy(inven_type *);
  705. int set_fire_destroy(inven_type *);
  706. int set_plasma_destroy(inven_type *);
  707. int set_meteor_destroy(inven_type *);
  708. int set_holy_destroy(inven_type *);
  709. int set_mana_destroy(inven_type *);
  710. int general_store(int);
  711. int armory(int);
  712. int weaponsmith(int);
  713. int temple(int);
  714. int alchemist(int);
  715. int magic_shop(int);
  716.  
  717. #ifdef MAC
  718. int store_buy(int, int);
  719. #endif
  720.  
  721. /* signals.c */
  722. void nosignals(void);
  723. void signals(void);
  724. void init_signals(void);
  725. void ignore_signals(void);
  726. void default_signals(void);
  727. void restore_signals(void);
  728.  
  729. /* spells.c */
  730. void monster_name(char *, struct monster_type *, struct creature_type *);
  731. void lower_monster_name(char *, struct monster_type *, struct creature_type *);
  732. int sleep_monsters1(int, int);
  733. int detect_treasure(void);
  734. int detect_object(void);
  735. int detect_trap(void);
  736. int detect_sdoor(void);
  737. int detect_invisible(void);
  738. int light_area(int, int, int, int);
  739. int unlight_area(int, int);
  740. void map_area(void);
  741. int ident_spell(void);
  742. int aggravate_monster(int);
  743. int trap_creation(void);
  744. int door_creation(void);
  745. int td_destroy(void);
  746. int detect_monsters(void);
  747. void mon_light_dam(int, int, int);
  748. void light_line(int, int, int);
  749. void frost_line(int, int, int, int);
  750. void starlite(int, int);
  751. int disarm_all(int, int, int);
  752. void get_flags(int, int32u *, int32u *, int (**)());
  753. void fire_bolt(int, int, int, int, int);
  754. void fire_ball(int, int, int, int, int, int);
  755. void breath(int, int, int, int, char *, int);
  756. int recharge(int);
  757. int hp_monster(int, int, int, int);
  758. int drain_life(int, int, int, int);
  759. int speed_monster(int, int, int, int);
  760. int confuse_monster(int, int, int, int);
  761. int sleep_monster(int, int, int);
  762. int wall_to_mud(int, int, int);
  763. int td_destroy2(int, int, int);
  764. int poly_monster(int, int, int);
  765. int build_wall(int, int, int);
  766. int clone_monster(int, int, int);
  767. void teleport_away(int, int);
  768. void teleport_to(int, int);
  769. int teleport_monster(int, int, int);
  770. int mass_genocide(int);
  771. int genocide(int);
  772. int speed_monsters(int);
  773. int sleep_monsters2(void);
  774. int mass_poly(void);
  775. int detect_evil(void);
  776. int hp_player(int);
  777. int cure_confusion(void);
  778. int cure_blindness(void);
  779. int cure_poison(void);
  780. int remove_fear(void);
  781. void earthquake(void);
  782. int protect_evil(void);
  783. void create_food(void);
  784. int dispel_creature(int, int);
  785. int turn_undead(void);
  786. void warding_glyph(void);
  787. void lose_str(void);
  788. void lose_int(void);
  789. void lose_wis(void);
  790. void lose_dex(void);
  791. void lose_con(void);
  792. void lose_chr(void);
  793. void lose_exp(int32);
  794. int slow_poison(void);
  795. void bless(int);
  796. void detect_inv2(int);
  797. void destroy_area(int, int);
  798. int enchant(inven_type *, int, int8u);
  799. void elemental_brand(void);
  800. int remove_curse(void);
  801. int restore_level(void);
  802. void self_knowledge(void);
  803. int probing(void);
  804. int detection(void);
  805. void starball(int,int);
  806. void bolt(int, int, int, int, char *, monster_type *, int);
  807. int lose_all_info(void);
  808. void tele_level(void);
  809. void identify_pack(void);
  810. int fear_monster(int, int, int, int);
  811. int banish_creature(int32u, int);
  812. int remove_all_curse(void);
  813. void darken_room(int, int);
  814. void lite_spot(int, int);
  815. const char *pain_message(int, int);
  816. void line_spell(int, int, int, int, int);
  817.  
  818. /* staffs.c */
  819. void use(void);
  820.  
  821. /* store1.c */
  822. int32 item_value(struct inven_type *);
  823. int32 sell_price(int, int32 *, int32 *, struct inven_type *);
  824. int store_check_num(inven_type *, int);
  825. void store_carry(int, int *, struct inven_type *);
  826. void store_destroy(int, int, int);
  827. void store_init(void);
  828. void store_maint(void);
  829. int noneedtobargain(int, int32);
  830. void updatebargain(int, int32, int32);
  831.  
  832. /* store2.c */
  833. void enter_store(int);
  834.  
  835. /* treasur1.c */
  836.  
  837. /* treasur2.c */
  838.  
  839. /* undef.c */
  840. void init_files(void);
  841. int _new_log(void);
  842.  
  843. #if defined(unix) || defined(AMIGA)
  844. /* unix.c */
  845. int check_input(int);
  846. #if 0
  847. int system_cmd(char *);
  848. #endif
  849. void user_name(char *, int);
  850. int tilde(const char *, char *);
  851. FILE *my_tfopen(const char *, const char *);
  852. int my_topen(const char *, int, int);
  853. #endif
  854.  
  855. /* util.c */
  856. #ifdef NEEDS_STRICMP
  857. int my_stricmp(const char *, const char *);
  858. #endif
  859. #ifdef NEEDS_USLEEP
  860. int microsleep(unsigned long);
  861. #endif
  862.  
  863. /* variable.c */
  864.  
  865. /* wands.c */
  866. void aim(void);
  867.  
  868. /* wizard.c */
  869. void wizard_light(int);
  870. void change_character(void);
  871. void wizard_create(void);
  872. void artifact_check(void);
  873. void artifact_check_no_file(void);
  874. void check_uniques(void);
  875. int is_wizard(int);
  876.  
  877. #else
  878.  
  879. /* create.c */
  880. void create_character();
  881.  
  882. /* creature.c */
  883. void update_mon();
  884. int movement_rate();
  885. int multiply_monster();
  886. void creatures();
  887.  
  888. /* death.c */
  889. void exit_game();
  890. void display_scores();
  891. void delete_entry();
  892. long total_points();
  893. int look_line();
  894.  
  895. /* desc.c */
  896. int is_a_vowel();
  897. void magic_init();
  898. void known1();
  899. int known1_p();
  900. void known2();
  901. int known2_p();
  902. void clear_known2();
  903. void clear_empty();
  904. void store_bought();
  905. int store_bought_p();
  906. void sample();
  907. void identify();
  908. void unmagic_name();
  909. void objdes();
  910. void scribe_object();
  911. void add_inscribe(); 
  912. void inscribe();
  913. void invcopy();
  914. void desc_charges();
  915. void desc_remain();
  916. int16 object_offset();
  917.  
  918. /* dungeon.c */
  919. void dungeon();
  920. int special_check();
  921. int is_quest();
  922. void rerate();
  923. int ruin_stat();
  924.  
  925. /* eat.c */
  926. void eat();
  927.  
  928. /* files.c */
  929. void init_scorefile();
  930. void init_files();
  931. void read_times();
  932. void helpfile();
  933. void print_objects();
  934. int file_character();
  935. #ifdef NEW_FILEPATHS
  936. void get_file_paths();
  937. #endif
  938.  
  939. /* generate.c */
  940. void generate_cave();
  941.  
  942. /* help.c */
  943. void ident_char();
  944.  
  945. /* io.c */
  946. #ifdef SIGTSTP
  947. int suspend();
  948. #endif
  949. void init_curses();
  950. void moriaterm();
  951. void put_buffer();
  952. void put_qio();
  953. void restore_term();
  954. void shell_out();
  955. char inkey();
  956. void flush();
  957. void erase_line();
  958. void clear_screen();
  959. void clear_from();
  960. void move_cursor_relative();
  961. void count_msg_print();
  962. void prt();
  963. void move_cursor();
  964. void msg_print();
  965. int get_check();
  966. int get_com();
  967. int get_string();
  968. void pause_line();
  969. void pause_exit();
  970. void save_screen();
  971. void restore_screen();
  972. void bell();
  973. void screen_map();
  974. void print();
  975.  
  976. /* magic.c */
  977. void cast();
  978.  
  979. /* main.c */
  980. int main();
  981.  
  982. /* misc1.c */
  983. void init_seeds();
  984. void set_seed();
  985. void reset_seed();
  986. int check_time();
  987. int randnor();
  988. int bit_pos();
  989. int next_to_walls();
  990. int next_to_corr();
  991. int damroll();
  992. int pdamroll();
  993. int los();
  994. unsigned char loc_symbol();
  995. int test_light();
  996. void prt_map();
  997. void add_food();
  998. int popm();
  999. int max_hp();
  1000. int place_monster();
  1001. int place_win_monster();
  1002. int get_mons_num();
  1003. void place_group();
  1004. void alloc_monster();
  1005. int summon_monster();
  1006. int summon_undead();
  1007. int popt();
  1008. void pusht();
  1009. int magik();
  1010. int m_bonus();
  1011. void magic_treasure();
  1012. int distance();
  1013.  
  1014. /* misc2.c */
  1015. void place_trap();
  1016. void place_rubble();
  1017. void place_gold();
  1018. int get_obj_num();
  1019. void place_object();
  1020. void alloc_object();
  1021. void random_object();
  1022. void cnv_stat();
  1023. void prt_stat();
  1024. void prt_field();
  1025. int stat_adj();
  1026. int chr_adj();
  1027. int con_adj();
  1028. char *title_string();
  1029. void prt_title();
  1030. void prt_level();
  1031. void prt_cmana();
  1032. void prt_mhp();
  1033. void prt_chp();
  1034. void prt_pac();
  1035. void prt_gold();
  1036. void prt_depth();
  1037. void prt_hunger();
  1038. void prt_blind();
  1039. void prt_confused();
  1040. void prt_afraid();
  1041. void prt_poisoned();
  1042. void prt_state();
  1043. void prt_speed();
  1044. void prt_study();
  1045. void prt_winner();
  1046. int16u modify_stat();
  1047. void set_use_stat();
  1048. int inc_stat();
  1049. int dec_stat();
  1050. int res_stat();
  1051. void bst_stat();
  1052. int tohit_adj();
  1053. int toac_adj();
  1054. int todis_adj();
  1055. int todam_adj();
  1056. void prt_stat_block();
  1057. void draw_cave();
  1058. void put_character();
  1059. void put_stats();
  1060. char *likert();
  1061. void put_misc1();
  1062. void put_misc2();
  1063. void put_misc3();
  1064. void display_char();
  1065. void get_name();
  1066. void change_name();
  1067. void inven_destroy();
  1068. void take_one_item();
  1069. void inven_drop();
  1070. int inven_damage();
  1071. int weight_limit();
  1072. int inven_check_num();
  1073. int inven_check_weight();
  1074. void check_strength();
  1075. int inven_carry();
  1076. int spell_chance();
  1077. void print_spells();
  1078. int get_spell();
  1079. void calc_spells();
  1080. void gain_spells();
  1081. void calc_mana();
  1082. void prt_experience();
  1083. void calc_hitpoints();
  1084. void insert_str();
  1085. void insert_lnum();
  1086. int enter_wiz_mode();
  1087. int attack_blows();
  1088. int tot_dam();
  1089. int critical_blow();
  1090. int mmove();
  1091. int player_saves();
  1092. int find_range();
  1093. void teleport();
  1094. void check_view();
  1095. void place_special();
  1096. int place_ghost();
  1097. void prt_cut();
  1098. void prt_stun();
  1099. void special_random_object();
  1100. void cut_player();
  1101. void stun_player();
  1102. extern void prt_equippy_chars();
  1103. void get_coin_type();
  1104.  
  1105. /* monsters.c */
  1106.  
  1107. /* moria1.c */
  1108. void change_speed();
  1109. void py_bonuses();
  1110. void calc_bonuses();
  1111. int show_inven();
  1112. char *describe_use();
  1113. int show_equip();
  1114. void takeoff();
  1115. void check_strength();
  1116. int verify();
  1117. void inven_command();
  1118. int get_item();
  1119. void panel_bounds();
  1120. int get_panel();
  1121. int no_light();
  1122. int get_dir();
  1123. int get_alldir();
  1124. void move_rec();
  1125. void light_room();
  1126. void move_light();
  1127. void disturb();
  1128. void search_on();
  1129. void search_off();
  1130. void rest();
  1131. void rest_off();
  1132. int test_hit();
  1133. void take_hit();
  1134. void change_trap();
  1135. void search();
  1136. void set_options();
  1137. void find_init();
  1138. void find_run();
  1139. void end_find();
  1140. void area_affect();
  1141. int minus_ac();
  1142. void corrode_gas();
  1143. void poison_gas();
  1144. void fire_dam();
  1145. void cold_dam();
  1146. void light_dam();
  1147. void acid_dam();
  1148. void lite_spot();
  1149. void darken_player();
  1150.  
  1151. /* moria2.c */
  1152. int cast_spell();
  1153. void delete_monster();
  1154. void fix1_delete_monster();
  1155. void fix2_delete_monster();
  1156. int multiply_monster();
  1157. int delete_object();
  1158. int32u monster_death();
  1159. int mon_take_hit();
  1160. void move_char();
  1161. void openobject();
  1162. void closeobject();
  1163. int twall();
  1164. void tunnel();
  1165. void disarm_trap();
  1166. void look();
  1167. void throw_object();
  1168. void bash();
  1169. void target();                    /* target fns stolen from Morgul -CFT */
  1170. int at_target();                /* target fns stolen from Morgul -CFT */
  1171. void mmove2();                    /* target fns stolen from Morgul -CFT */
  1172.  
  1173. #ifdef MSDOS
  1174. /* ms_misc.c */
  1175. char *getlogin();
  1176. #ifdef __TURBOC__
  1177. void sleep();
  1178. #else
  1179. unsigned int sleep();
  1180. #endif
  1181. void error();
  1182. void warn();
  1183. void msdos_init();
  1184. void msdos_raw();
  1185. void msdos_noraw();
  1186. int bios_getch();
  1187. int msdos_getch();
  1188. void bios_clear();
  1189. void msdos_intro();
  1190. void msdos_print_map();
  1191. void bios_clear();
  1192. #endif
  1193.  
  1194. /* potions.c */
  1195. void quaff();
  1196.  
  1197. /* prayer.c */
  1198. void pray();
  1199.  
  1200. /* recall.c */
  1201. int bool_roff_recall();
  1202. int roff_recall();
  1203.  
  1204. /* rnd.c is unused now -CWS */
  1205. /* random.c */
  1206. #if !(defined(linux) || defined(__osf__))
  1207. long random();
  1208. void srandom();
  1209. char *initstate();
  1210. char *setstate();
  1211. #endif
  1212.  
  1213. /* save.c */
  1214. int save_char();
  1215. int _save_char();
  1216. int get_char();
  1217.  
  1218. /* scrolls.c */
  1219. void read_scroll();
  1220.  
  1221. /* sets.c */
  1222. int set_room();
  1223. int set_corr();
  1224. int set_floor();
  1225. int set_corrodes();
  1226. int set_flammable();
  1227. int set_frost_destroy();
  1228. int set_acid_affect();
  1229. int set_lightning_destroy();
  1230. int set_null();
  1231. int set_acid_destroy();
  1232. int set_fire_destroy();
  1233. int set_plasma_destroy();
  1234. int set_meteor_destroy();
  1235. int set_holy_destroy();
  1236. int set_mana_destroy();
  1237. int general_store();
  1238. int armory();
  1239. int weaponsmith();
  1240. int temple();
  1241. int alchemist();
  1242. int magic_shop();
  1243. #ifdef MAC
  1244. int store_buy();
  1245. #endif
  1246.  
  1247. /* signals.c */
  1248. void nosignals();
  1249. void signals();
  1250. void init_signals();
  1251. void ignore_signals();
  1252. void default_signals();
  1253. void restore_signals();
  1254.  
  1255. /* spells.c */
  1256. void monster_name();
  1257. void lower_monster_name();
  1258. int sleep_monsters1();
  1259. int detect_treasure();
  1260. int detect_object();
  1261. int detect_trap();
  1262. int detect_sdoor();
  1263. int detect_invisible();
  1264. int light_area();
  1265. int unlight_area();
  1266. void map_area();
  1267. int ident_spell();
  1268. int aggravate_monster();
  1269. int trap_creation();
  1270. int door_creation();
  1271. int td_destroy();
  1272. int detect_monsters();
  1273. void light_line();
  1274. void starlite();
  1275. int disarm_all();
  1276. void get_flags();
  1277. void fire_bolt();
  1278. void fire_ball();
  1279. void breath();
  1280. int recharge();
  1281. int hp_monster();
  1282. int drain_life();
  1283. int speed_monster();
  1284. int confuse_monster();
  1285. int sleep_monster();
  1286. int wall_to_mud();
  1287. int td_destroy2();
  1288. int poly_monster();
  1289. int build_wall();
  1290. int clone_monster();
  1291. void teleport_away();
  1292. void teleport_to();
  1293. int teleport_monster();
  1294. int mass_genocide();
  1295. int genocide();
  1296. int speed_monsters();
  1297. int sleep_monsters2();
  1298. int mass_poly();
  1299. int detect_evil();
  1300. int hp_player();
  1301. int cure_confusion();
  1302. int cure_blindness();
  1303. int cure_poison();
  1304. int remove_fear();
  1305. void earthquake();
  1306. int protect_evil();
  1307. void create_food();
  1308. int dispel_creature();
  1309. int turn_undead();
  1310. void warding_glyph();
  1311. void lose_str();
  1312. void lose_int();
  1313. void lose_wis();
  1314. void lose_dex();
  1315. void lose_con();
  1316. void lose_chr();
  1317. void lose_exp();
  1318. int slow_poison();
  1319. void bless();
  1320. void detect_inv2();
  1321. void destroy_area();
  1322. int enchant();
  1323. int remove_curse();
  1324. int restore_level();
  1325. void self_knowledge();
  1326. char *pain_message()
  1327. void line_spell();
  1328.  
  1329. /* staffs.c */
  1330. void use();
  1331.  
  1332. /* store1.c */
  1333. int32 item_value();
  1334. int32 sell_price();
  1335. int store_check_num();
  1336. void store_carry();
  1337. void store_destroy();
  1338. void store_init();
  1339. void store_maint();
  1340. int noneedtobargain();
  1341. void updatebargain();
  1342.  
  1343. /* store2.c */
  1344. void enter_store();
  1345.  
  1346. /* treasur1.c */
  1347.  
  1348. /* treasur2.c */
  1349.  
  1350. /* undef.c */
  1351. void init_files();
  1352. int _new_log();
  1353.  
  1354. #ifdef unix
  1355. /* unix.c */
  1356. int check_input();
  1357. #if 0
  1358. int system_cmd();
  1359. #endif
  1360. void user_name();
  1361. int tilde();
  1362. /* only declare this if stdio.h has been previously included, which will
  1363.  * be true if stdin is defined
  1364.  */
  1365. #ifdef stdin
  1366. FILE *my_tfopen();
  1367. #endif
  1368. int my_topen();
  1369. #endif
  1370.  
  1371. /* util.c */
  1372. #ifdef NEEDS_STRICMP
  1373. int my_stricmp();
  1374. #endif
  1375. #ifdef NEEDS_USLEEP
  1376. int microsleep();
  1377. #endif
  1378.  
  1379. /* variable.c */
  1380.  
  1381. /* wands.c */
  1382. void aim();
  1383.  
  1384. /* wizard.c */
  1385. void wizard_light();
  1386. void change_character();
  1387. void wizard_create();
  1388. void artifact_check();
  1389. void artifact_check_no_file();
  1390. void check_uniques();
  1391. int is_wizard();
  1392. #endif      /* __STDC__ */
  1393.